package br.roove.bomotivo.ui;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import br.roove.bomotivo.util.BitmapLoader;

import com.koushikdutta.urlimageviewhelper.UrlImageViewHelper;

public class FotoAumentada extends Fragment {
	
	String URL_FOTO;
	ImageButton bt1;
	ImageButton bt2;
	ImageButton bt3;
	SharedPreferences prefs;
	SharedPreferences.Editor prefs2;
	
	

	public FotoAumentada(String uRL_FOTO) {
		super();
		URL_FOTO = uRL_FOTO;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		
		prefs = this.getActivity().getSharedPreferences("eventospref", 0);
		prefs2 = this.getActivity().getSharedPreferences("eventospref", 0).edit();
		
		prefs2.putString("nome2", prefs.getString("nome1", "")).commit();
		prefs2.putString("nome1", "").commit();
		
		View view = inflater.inflate(R.layout.foto_aumentada, container, false);
		
		bt1 = (ImageButton)getActivity().findViewById(R.id.imagebuttonEventos);
		bt2 = (ImageButton)getActivity().findViewById(R.id.imagebuttonPrincipal);
		bt3 = (ImageButton)getActivity().findViewById(R.id.imagebuttonFoto);
		bt1.setClickable(false);
		bt2.setClickable(false);
		bt3.setClickable(false);
		
		ImageView img = (ImageView)view.findViewById(R.id.image_big);
//		UrlImageViewHelper uhelper = new UrlImageViewHelper();
//		uhelper.setUrlDrawable(img, URL_FOTO);
		img.setImageResource(android.R.drawable.btn_dialog);
		img.setTag(URL_FOTO);
		new BitmapLoader().execute(img);
		
		return view;
	}
	
	
	

}
